#pragma once

#include <gexpl_dac_r12dh.h>

typedef struct {
	dac_r12dh_expl_s digital_12_bit_a[2];
} dac_c_r12dh_expl_s;

_Static_assert(sizeof(dac_c_r12dh_expl_s) == 4,
	       "Struct dac_c_r12dh_expl_s defined error!");

// 并发设置两个DAC的数字值为给定12位整数（右对齐）
static inline void
dac_concurrent_set_12_bit_digital_right(dac_c_r12dh_expl_s c_r12dh) {
	union {
		dac_c_r12dh_expl_s e;
		u32_s u;
	} eu = {
		.e = c_r12dh,
	};
	dac_wreg_dh(DACC_DH_R, DAC_DH_R12DH_RR, eu.u);
}
